package emulator.shell.GUI.profiling;

public class CodeTableData implements Comparable<CodeTableData>
{
	private int address;
	private long sumTicks;
	private int hitCount;
	private String label;
	
	public CodeTableData(int address, int sumTicks, int hitCount, String label)
	{
		this.address = address;
		this.sumTicks = sumTicks;
		this.hitCount = hitCount;
		this.label = label;
	}
	
	public int getAddress() {
		return address;
	}
	public void setAddress(int address) {
		this.address = address;
	}
	public long getSumTicks() {
		return sumTicks;
	}
	public void setSumTicks(long sumTicks) {
		this.sumTicks = sumTicks;
	}
	public int getHitCount() {
		return hitCount;
	}
	public void setHitCount(int hitCount) {
		this.hitCount = hitCount;
	}
	public String getLabel() {
		return label;
	}
	public void setLabel(String label) {
		this.label = label;
	}

	@Override
	public int compareTo(CodeTableData o)
	{
		long diff = o.getSumTicks() - getSumTicks();
		return diff != 0 ? (int)(diff/Math.abs(diff)) : 0;
	}
}
